#!/usr/bin/env python
# -*- coding: utf-8 -*-
assert hasattr(str, 'isnumeric'), 'Python version check.'


def ask_sir_robin(question):
    """Get answer to question."""
    answer = {
        'What is your name?': 'Sir Robin of Camelot.',
        'What is your quest?': 'To seek the Holy Grail.',
        'What is your favorite color?': 'Green.',
    }
    try:
        result = answer[question]
    except KeyError as e:  # Except...as syntax.
        raise KeyError("I don't know that!\n" + str(e))
    return result


def haggle(ask, offer):
    """Haggle for final price (accepts between 80 & 84% of asking price)."""
    pct = offer / ask   # Division.

    if pct < 0.80:
        response = str(offer) + '? Are you joking?'
    elif pct > 0.84:
        response = 'No, no. Do it properly.'
    else:
        response = 'Done! ' + str(offer) + ' shekels.'

    return response


def in_lingerie_shop(item):
    """Check if item is in lingerie shop."""
    inventory = {'corsets',  # Set literal.
                 'stockings',
                 'suspender belts',
                 'tights',
                 'bras',
                 'slips',
                 'petty coats',
                 'knickers',
                 'socks',
                 'garters'}
    return item in inventory
